<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The AQUA Project, Glasgow University, 1993-1998

-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-comment">-- | Typechecking @default@ declarations</span><span>
</span><span id="line-9"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Tc.Gen.Default</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Default.html#tcDefaults"><span class="hs-identifier">tcDefaults</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Class.html"><span class="hs-identifier">GHC.Core.Class</span></a></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.HsType.html"><span class="hs-identifier">GHC.Tc.Gen.HsType</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html"><span class="hs-identifier">GHC.Tc.Utils.Zonk</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Solver.html"><span class="hs-identifier">GHC.Tc.Solver</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Validity.html"><span class="hs-identifier">GHC.Tc.Validity</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.LanguageExtensions.html#"><span class="hs-identifier">GHC.LanguageExtensions</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LangExt</span></span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="annot"><a href="GHC.Tc.Gen.Default.html#tcDefaults"><span class="hs-identifier hs-type">tcDefaults</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Decls.html#LDefaultDecl"><span class="hs-identifier hs-type">LDefaultDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-29"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- Defaulting types to heave</span><span>
</span><span id="line-30"></span><span>                                    </span><span class="hs-comment">-- into Tc monad for later use</span><span>
</span><span id="line-31"></span><span>                                    </span><span class="hs-comment">-- in Disambig.</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span id="tcDefaults"><span class="annot"><span class="annottext">tcDefaults :: [LDefaultDecl GhcRn] -&gt; TcM (Maybe [Type])
</span><a href="GHC.Tc.Gen.Default.html#tcDefaults"><span class="hs-identifier hs-var hs-var">tcDefaults</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-34"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcM (Maybe [Type])
</span><a href="GHC.Tc.Utils.Monad.html#getDeclaredDefaultTys"><span class="hs-identifier hs-var">getDeclaredDefaultTys</span></a></span><span>       </span><span class="hs-comment">-- No default declaration, so get the</span><span>
</span><span id="line-35"></span><span>                                </span><span class="hs-comment">-- default types from the envt;</span><span>
</span><span id="line-36"></span><span>                                </span><span class="hs-comment">-- i.e. use the current ones</span><span>
</span><span id="line-37"></span><span>                                </span><span class="hs-comment">-- (the caller will put them back there)</span><span>
</span><span id="line-38"></span><span>        </span><span class="hs-comment">-- It's important not to return defaultDefaultTys here (which</span><span>
</span><span id="line-39"></span><span>        </span><span class="hs-comment">-- we used to do) because in a TH program, tcDefaults [] is called</span><span>
</span><span id="line-40"></span><span>        </span><span class="hs-comment">-- repeatedly, once for each group of declarations between top-level</span><span>
</span><span id="line-41"></span><span>        </span><span class="hs-comment">-- splices.  We don't want to carefully set the default types in</span><span>
</span><span id="line-42"></span><span>        </span><span class="hs-comment">-- one group, only for the next group to ignore them and install</span><span>
</span><span id="line-43"></span><span>        </span><span class="hs-comment">-- defaultDefaultTys</span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="annot"><a href="GHC.Tc.Gen.Default.html#tcDefaults"><span class="hs-identifier hs-var">tcDefaults</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#DefaultDecl"><span class="hs-identifier hs-type">DefaultDecl</span></a></span><span> </span><span class="annot"><span class="annottext">XCDefaultDecl GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-46"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe [Type] -&gt; TcM (Maybe [Type])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; Maybe [Type]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>            </span><span class="hs-comment">-- Default declaration specifying no types</span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="annot"><a href="GHC.Tc.Gen.Default.html#tcDefaults"><span class="hs-identifier hs-var">tcDefaults</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681175959"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681175959"><span class="hs-identifier hs-var">locn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#DefaultDecl"><span class="hs-identifier hs-type">DefaultDecl</span></a></span><span> </span><span class="annot"><span class="annottext">XCDefaultDecl GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681175958"><span class="annot"><span class="annottext">[LHsType GhcRn]
</span><a href="#local-6989586621681175958"><span class="hs-identifier hs-var">mono_tys</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-49"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcM (Maybe [Type]) -&gt; TcM (Maybe [Type])
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681175959"><span class="hs-identifier hs-var">locn</span></a></span><span>                     </span><span class="annot"><span class="annottext">(TcM (Maybe [Type]) -&gt; TcM (Maybe [Type]))
-&gt; TcM (Maybe [Type]) -&gt; TcM (Maybe [Type])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-50"></span><span>    </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM (Maybe [Type]) -&gt; TcM (Maybe [Type])
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Tc.Gen.Default.html#defaultDeclCtxt"><span class="hs-identifier hs-var">defaultDeclCtxt</span></a></span><span>          </span><span class="annot"><span class="annottext">(TcM (Maybe [Type]) -&gt; TcM (Maybe [Type]))
-&gt; TcM (Maybe [Type]) -&gt; TcM (Maybe [Type])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681175954"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681175954"><span class="hs-identifier hs-var">ovl_str</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; TcRnIf TcGblEnv TcLclEnv Bool
forall gbl lcl. Extension -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#xoptM"><span class="hs-identifier hs-var">xoptM</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#OverloadedStrings"><span class="hs-identifier hs-var">LangExt.OverloadedStrings</span></a></span><span>
</span><span id="line-52"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681175951"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681175951"><span class="hs-identifier hs-var">ext_deflt</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; TcRnIf TcGblEnv TcLclEnv Bool
forall gbl lcl. Extension -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#xoptM"><span class="hs-identifier hs-var">xoptM</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#ExtendedDefaultRules"><span class="hs-identifier hs-var">LangExt.ExtendedDefaultRules</span></a></span><span>
</span><span id="line-53"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681175949"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681175949"><span class="hs-identifier hs-var">num_class</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM Class
</span><a href="GHC.Tc.Utils.Env.html#tcLookupClass"><span class="hs-identifier hs-var">tcLookupClass</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#numClassName"><span class="hs-identifier hs-var">numClassName</span></a></span><span>
</span><span id="line-54"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681175946"><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681175946"><span class="hs-identifier hs-var">deflt_str</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681175954"><span class="hs-identifier hs-var">ovl_str</span></a></span><span>
</span><span id="line-55"></span><span>                       </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; TcM Class)
-&gt; [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Class]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM Class
</span><a href="GHC.Tc.Utils.Env.html#tcLookupClass"><span class="hs-identifier hs-var">tcLookupClass</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#isStringClassName"><span class="hs-identifier hs-var">isStringClassName</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-56"></span><span>                       </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[Class] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Class]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-57"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681175943"><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681175943"><span class="hs-identifier hs-var">deflt_interactive</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681175951"><span class="hs-identifier hs-var">ext_deflt</span></a></span><span>
</span><span id="line-58"></span><span>                               </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; TcM Class)
-&gt; [Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Class]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM Class
</span><a href="GHC.Tc.Utils.Env.html#tcLookupClass"><span class="hs-identifier hs-var">tcLookupClass</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="GHC.Builtin.Names.html#interactiveClassNames"><span class="hs-identifier hs-var">interactiveClassNames</span></a></span><span>
</span><span id="line-59"></span><span>                               </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[Class] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Class]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-60"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681175941"><span class="annot"><span class="annottext">deflt_clss :: [Class]
</span><a href="#local-6989586621681175941"><span class="hs-identifier hs-var hs-var">deflt_clss</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681175949"><span class="hs-identifier hs-var">num_class</span></a></span><span> </span><span class="annot"><span class="annottext">Class -&gt; [Class] -&gt; [Class]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681175946"><span class="hs-identifier hs-var">deflt_str</span></a></span><span> </span><span class="annot"><span class="annottext">[Class] -&gt; [Class] -&gt; [Class]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681175943"><span class="hs-identifier hs-var">deflt_interactive</span></a></span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681175940"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681175940"><span class="hs-identifier hs-var">tau_tys</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LHsType GhcRn -&gt; TcRn Type) -&gt; [LHsType GhcRn] -&gt; TcRn [Type]
forall a b. (a -&gt; TcRn b) -&gt; [a] -&gt; TcRn [b]
</span><a href="GHC.Tc.Utils.Monad.html#mapAndReportM"><span class="hs-identifier hs-var">mapAndReportM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Class] -&gt; LHsType GhcRn -&gt; TcRn Type
</span><a href="GHC.Tc.Gen.Default.html#tc_default_ty"><span class="hs-identifier hs-var">tc_default_ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681175941"><span class="hs-identifier hs-var">deflt_clss</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsType GhcRn]
</span><a href="#local-6989586621681175958"><span class="hs-identifier hs-var">mono_tys</span></a></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe [Type] -&gt; TcM (Maybe [Type])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; Maybe [Type]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681175940"><span class="hs-identifier hs-var">tau_tys</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="annot"><a href="GHC.Tc.Gen.Default.html#tcDefaults"><span class="hs-identifier hs-var">tcDefaults</span></a></span><span> </span><span id="local-6989586621681175937"><span class="annot"><span class="annottext">decls :: [LDefaultDecl GhcRn]
</span><a href="#local-6989586621681175937"><span class="hs-identifier hs-var">decls</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681175936"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681175936"><span class="hs-identifier hs-var">locn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#DefaultDecl"><span class="hs-identifier hs-type">DefaultDecl</span></a></span><span> </span><span class="annot"><span class="annottext">XCDefaultDecl GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[LHsType GhcRn]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[LDefaultDecl GhcRn]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcM (Maybe [Type]) -&gt; TcM (Maybe [Type])
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681175936"><span class="hs-identifier hs-var">locn</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (Maybe [Type]) -&gt; TcM (Maybe [Type]))
-&gt; TcM (Maybe [Type]) -&gt; TcM (Maybe [Type])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-68"></span><span>    </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcM (Maybe [Type])
forall a. MsgDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LDefaultDecl GhcRn] -&gt; MsgDoc
</span><a href="GHC.Tc.Gen.Default.html#dupDefaultDeclErr"><span class="hs-identifier hs-var">dupDefaultDeclErr</span></a></span><span> </span><span class="annot"><span class="annottext">[LDefaultDecl GhcRn]
</span><a href="#local-6989586621681175937"><span class="hs-identifier hs-var">decls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="annot"><a href="GHC.Tc.Gen.Default.html#tc_default_ty"><span class="hs-identifier hs-type">tc_default_ty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#LHsType"><span class="hs-identifier hs-type">LHsType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-72"></span><span id="tc_default_ty"><span class="annot"><span class="annottext">tc_default_ty :: [Class] -&gt; LHsType GhcRn -&gt; TcRn Type
</span><a href="GHC.Tc.Gen.Default.html#tc_default_ty"><span class="hs-identifier hs-var hs-var">tc_default_ty</span></a></span></span><span> </span><span id="local-6989586621681175933"><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681175933"><span class="hs-identifier hs-var">deflt_clss</span></a></span></span><span> </span><span id="local-6989586621681175932"><span class="annot"><span class="annottext">LHsType GhcRn
</span><a href="#local-6989586621681175932"><span class="hs-identifier hs-var">hs_ty</span></a></span></span><span>
</span><span id="line-73"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>   </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681175931"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175931"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn Type -&gt; TcRn Type
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Tc.Solver.html#solveEqualities"><span class="hs-identifier hs-var">solveEqualities</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn Type -&gt; TcRn Type) -&gt; TcRn Type -&gt; TcRn Type
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-74"></span><span>                </span><span class="annot"><span class="annottext">LHsType GhcRn -&gt; TcRn Type
</span><a href="GHC.Tc.Gen.HsType.html#tcInferLHsType"><span class="hs-identifier hs-var">tcInferLHsType</span></a></span><span> </span><span class="annot"><span class="annottext">LHsType GhcRn
</span><a href="#local-6989586621681175932"><span class="hs-identifier hs-var">hs_ty</span></a></span><span>
</span><span id="line-75"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681175928"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175928"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; TcRn Type
</span><a href="GHC.Tc.Utils.Zonk.html#zonkTcTypeToType"><span class="hs-identifier hs-var">zonkTcTypeToType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175931"><span class="hs-identifier hs-var">ty</span></a></span><span>   </span><span class="hs-comment">-- establish Type invariants</span><span>
</span><span id="line-76"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt -&gt; Type -&gt; TcM ()
</span><a href="GHC.Tc.Validity.html#checkValidType"><span class="hs-identifier hs-var">checkValidType</span></a></span><span> </span><span class="annot"><span class="annottext">UserTypeCtxt
</span><a href="GHC.Tc.Types.Origin.html#DefaultDeclCtxt"><span class="hs-identifier hs-var">DefaultDeclCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175928"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span>        </span><span class="hs-comment">-- Check that the type is an instance of at least one of the deflt_clss</span><span>
</span><span id="line-79"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681175924"><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621681175924"><span class="hs-identifier hs-var">oks</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Class -&gt; TcRnIf TcGblEnv TcLclEnv Bool)
-&gt; [Class] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Bool]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Class -&gt; TcRnIf TcGblEnv TcLclEnv Bool
</span><a href="GHC.Tc.Gen.Default.html#check_instance"><span class="hs-identifier hs-var">check_instance</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175928"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681175933"><span class="hs-identifier hs-var">deflt_clss</span></a></span><span>
</span><span id="line-80"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; MsgDoc -&gt; TcM ()
</span><a href="GHC.Tc.Utils.Monad.html#checkTc"><span class="hs-identifier hs-var">checkTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Bool] -&gt; Bool
forall (t :: * -&gt; *). Foldable t =&gt; t Bool -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#or"><span class="hs-identifier hs-var">or</span></a></span><span> </span><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621681175924"><span class="hs-identifier hs-var">oks</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; [Class] -&gt; MsgDoc
</span><a href="GHC.Tc.Gen.Default.html#badDefaultTy"><span class="hs-identifier hs-var">badDefaultTy</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175928"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681175933"><span class="hs-identifier hs-var">deflt_clss</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Type -&gt; TcRn Type
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175928"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="annot"><a href="GHC.Tc.Gen.Default.html#check_instance"><span class="hs-identifier hs-type">check_instance</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-84"></span><span>  </span><span class="hs-comment">-- Check that ty is an instance of cls</span><span>
</span><span id="line-85"></span><span>  </span><span class="hs-comment">-- We only care about whether it worked or not; return a boolean</span><span>
</span><span id="line-86"></span><span id="check_instance"><span class="annot"><span class="annottext">check_instance :: Type -&gt; Class -&gt; TcRnIf TcGblEnv TcLclEnv Bool
</span><a href="GHC.Tc.Gen.Default.html#check_instance"><span class="hs-identifier hs-var hs-var">check_instance</span></a></span></span><span> </span><span id="local-6989586621681175919"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175919"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681175918"><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681175918"><span class="hs-identifier hs-var">cls</span></a></span></span><span>
</span><span id="line-87"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681175917"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681175917"><span class="hs-identifier hs-var">success</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn ((), Bool) -&gt; TcRn ((), Bool)
forall a. TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#discardErrs"><span class="hs-identifier hs-var">discardErrs</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn ((), Bool) -&gt; TcRn ((), Bool))
-&gt; TcRn ((), Bool) -&gt; TcRn ((), Bool)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-88"></span><span>                          </span><span class="annot"><span class="annottext">TcM () -&gt; TcRn ((), Bool)
forall a. TcRn a -&gt; TcRn (a, Bool)
</span><a href="GHC.Tc.Utils.Monad.html#askNoErrs"><span class="hs-identifier hs-var">askNoErrs</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM () -&gt; TcRn ((), Bool)) -&gt; TcM () -&gt; TcRn ((), Bool)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-89"></span><span>                          </span><span class="annot"><span class="annottext">[Type] -&gt; TcM ()
</span><a href="GHC.Tc.Solver.html#simplifyDefault"><span class="hs-identifier hs-var">simplifyDefault</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Class -&gt; [Type] -&gt; Type
</span><a href="GHC.Core.Predicate.html#mkClassPred"><span class="hs-identifier hs-var">mkClassPred</span></a></span><span> </span><span class="annot"><span class="annottext">Class
</span><a href="#local-6989586621681175918"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175919"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">]</span><span class="hs-special">]</span><span>
</span><span id="line-90"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRnIf TcGblEnv TcLclEnv Bool
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681175917"><span class="hs-identifier hs-var">success</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span class="annot"><a href="GHC.Tc.Gen.Default.html#defaultDeclCtxt"><span class="hs-identifier hs-type">defaultDeclCtxt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-93"></span><span id="defaultDeclCtxt"><span class="annot"><span class="annottext">defaultDeclCtxt :: MsgDoc
</span><a href="GHC.Tc.Gen.Default.html#defaultDeclCtxt"><span class="hs-identifier hs-var hs-var">defaultDeclCtxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;When checking the types in a default declaration&quot;</span></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="annot"><a href="GHC.Tc.Gen.Default.html#dupDefaultDeclErr"><span class="hs-identifier hs-type">dupDefaultDeclErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#DefaultDecl"><span class="hs-identifier hs-type">DefaultDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-96"></span><span id="dupDefaultDeclErr"><span class="annot"><span class="annottext">dupDefaultDeclErr :: [LDefaultDecl GhcRn] -&gt; MsgDoc
</span><a href="GHC.Tc.Gen.Default.html#dupDefaultDeclErr"><span class="hs-identifier hs-var hs-var">dupDefaultDeclErr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#DefaultDecl"><span class="hs-identifier hs-type">DefaultDecl</span></a></span><span> </span><span class="annot"><span class="annottext">XCDefaultDecl GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[LHsType GhcRn]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681175909"><span class="annot"><span class="annottext">[LDefaultDecl GhcRn]
</span><a href="#local-6989586621681175909"><span class="hs-identifier hs-var">dup_things</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-97"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Multiple default declarations&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-98"></span><span>       </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LDefaultDecl GhcRn -&gt; MsgDoc) -&gt; [LDefaultDecl GhcRn] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LDefaultDecl GhcRn -&gt; MsgDoc
</span><a href="#local-6989586621681175906"><span class="hs-identifier hs-var">pp</span></a></span><span> </span><span class="annot"><span class="annottext">[LDefaultDecl GhcRn]
</span><a href="#local-6989586621681175909"><span class="hs-identifier hs-var">dup_things</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-99"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-100"></span><span>    </span><span class="annot"><a href="#local-6989586621681175906"><span class="hs-identifier hs-type">pp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#DefaultDecl"><span class="hs-identifier hs-type">DefaultDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-101"></span><span>    </span><span id="local-6989586621681175906"><span class="annot"><span class="annottext">pp :: LDefaultDecl GhcRn -&gt; MsgDoc
</span><a href="#local-6989586621681175906"><span class="hs-identifier hs-var hs-var">pp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681175905"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681175905"><span class="hs-identifier hs-var">locn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#DefaultDecl"><span class="hs-identifier hs-type">DefaultDecl</span></a></span><span> </span><span class="annot"><span class="annottext">XCDefaultDecl GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[LHsType GhcRn]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-102"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;here was another default declaration&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681175905"><span class="hs-identifier hs-var">locn</span></a></span><span>
</span><span id="line-103"></span><span class="annot"><a href="GHC.Tc.Gen.Default.html#dupDefaultDeclErr"><span class="hs-identifier hs-var">dupDefaultDeclErr</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dupDefaultDeclErr []&quot;</span></span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span class="annot"><a href="GHC.Tc.Gen.Default.html#badDefaultTy"><span class="hs-identifier hs-type">badDefaultTy</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Class.html#Class"><span class="hs-identifier hs-type">Class</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-106"></span><span id="badDefaultTy"><span class="annot"><span class="annottext">badDefaultTy :: Type -&gt; [Class] -&gt; MsgDoc
</span><a href="GHC.Tc.Gen.Default.html#badDefaultTy"><span class="hs-identifier hs-var hs-var">badDefaultTy</span></a></span></span><span> </span><span id="local-6989586621681175901"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175901"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681175900"><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681175900"><span class="hs-identifier hs-var">deflt_clss</span></a></span></span><span>
</span><span id="line-107"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The default type&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681175901"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not an instance of&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-108"></span><span>       </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(MsgDoc -&gt; MsgDoc -&gt; MsgDoc) -&gt; [MsgDoc] -&gt; MsgDoc
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldr1"><span class="hs-identifier hs-var">foldr1</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681175895"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681175895"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621681175894"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681175894"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681175895"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;or&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681175894"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Class -&gt; MsgDoc) -&gt; [Class] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span class="annot"><span class="annottext">(MsgDoc -&gt; MsgDoc) -&gt; (Class -&gt; MsgDoc) -&gt; Class -&gt; MsgDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Class -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Class]
</span><a href="#local-6989586621681175900"><span class="hs-identifier hs-var">deflt_clss</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-109"></span></pre></body></html>